AlaskaLinuxUser's Scratchpad

Commit thy works unto the LORD, and thy thoughts shall be established. - Proverbs 16:3

Getting CitySim basics ironed out

20260423.png

One thing I've learned from this project is that building a game is not easy. Not just the programming part, which is hard for me, due to my limited skillset, but also the part about planning a game. Figuring out how everything should work is actually a lot of work! At the same time, it is also quite a bit of fun. If you are wondering what I'm even talking about, well, I'm talking about CitySim [1], my fork to build a city simulation (think "Sim City") style game for Ubuntu Touch. It's coming along, and I'm now ready to work on the game part of the game itself. To get to this point, though, I had to 'iron out' some of the rough edges and get all the tiles and pieces ready. Sort of like physically making all the pieces for the chess board, before you can work on how the pieces move.

Some of those basic pieces I built were adding in the entertainment tile, which for now is a baseball stadium. It is expensive to build, but it actually makes you some money and dramatically increases the entertainment value of your city (other entertainment increasers would be things like the park tile). Another fun one is the space rocket launch pad. It is extreamly expensive to build and maintain, but I hope to use it in the game play mode, where the final mission will be putting your city's mark on the moon! Not to mention that it will really help your city stats in other ways.

Previously, I mentioned that I had added pollution to the game. Well, I've also added, crime, health, entertainment, and education to the mix. Now, before a residential area can upgrade past level 2, it requires a certain ammount of entertainment, a low enough crime rate, and the overall availability of doctors and medical care. Likewise, industrial and commercial zones are limited from upgrading past level 2 unless the education level of the workers is high enough, plus a crime rate low enough to support investment, a certain ammount of people to fill the jobs, and so on and so forth. While I may still need to tweak the levels and ammounts, the overall game mechanics are all in place now. Population, income, all of these things are in place.

Other basic features are also now working, such as the ability to save the game, and the ability to load that saved game next time you play. While I didn't have to fix the feature itself, it didn't work before due to some of the saved tiles returning null values that caused issues. That is all fixed. The ability to save and load the game is a huge milestone, as now the game can actually be played whenever you want, being able to whip out your phone at the bus stop, play a few minutes, save the game and come back to it later, instead of having to play the whole game in one sitting, which is not practical.

As I also mentioned before, there are "assistants" which are still a work in progress at the moment, but the idea is that they can "pop up" to tell you when there is a problem. What I am still working out is how often they can pop up. I could have them pop up every time there is a problem. For example, if you can't upgrade a residential zone because you have too much crime, the pollice officer could pop up and tell you the crime rate is too high, reminding you to build more police stations. However, I would need some sort of timer function to prevent six residential zones, all built at the same time, from all trying to upgrade at the same moment, creating six police officer popups. Another option would be to have a certain time of year, where the officer would pop up and make a report. Every month is 30 seconds, so having him pop up once a month seems like too much. You would see a pop up from him twice a minute. Likewise, if you made it once a year, you would get a report from him every six minutes.

A report every six minutes doesn't sound bad, but then again, there is the fire chief, doctor, conservationalist, etc., that all need to make reports. It would end up being a different report, from a different person/division of the game, every 30 seconds, which is a lot of popups. So I either need a non-invasive pop up, or an even more limiting way to keep the reports at bay. I'm still working that out. For now, I have 'tabled' that portion of the game and will focus on it later, as I don't feel it impedes the game development in any way.

Another thing I am still figuring out is the fire department. Currently, the 'crime rate' keeps buildings from upgrading. But I didn't do that with the 'fire hazard rate'. I could just add that in as part of the game, but I was wondering about a possible alternative. One idea I had was that if your fire hazard rate was too high, random buildings would catch fire, burning down, and then you would need to rebuild them. Obviously, if you keep your fire hazard rate low enough, there will not be any fires, so if you don't want to lose buildings, money, potential population, you would just build more fire departments. But if you like living on the edge, you could not build fire departments and face a random blaze every now and again, requiring you to rebuild buildings as they burn down. This doesn't seem hard to implement, so I may give it a try and see how I like it.

Asside from those, the last big hurdle before building all of the game objectives/selection screen is that of the city status page. I really want it to look beautiful, so I am working hard on that. Essentially, when you click on the graph image at the bottom of the screen, you should get a graphical update on all the variables, like crime rate, pollution, fire hazzard, etc., so you know what you need to do for your city. One thought I had was integrating the assistants into this. Perhaps when you click on one, the assistant could pop up to tell you something you should do, but it seems a bit redundant, if you understand the graphs, so we will have to see.

Either way, most of the 'grunt work' is already done, so I'm feeling pretty positive about this project!

Linux - keep it simple.

[1] https://gitlab.com/alaskalinuxuser/citysim-ubuntutouch